package cn.huaqingcheng.tianshu.infrastructure.sys.adapter;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;

/**
 * AlibabaCloudObjectStorageProperties
 */
@Data
@NoArgsConstructor
@ConfigurationProperties(prefix = "file.alioss")
public class AlibabaCloudObjectStorageProperties {

    /**
     * 存储桶
     */
    private String bucket;

    /**
     * 区域 例如 {@code cn-hangzhou}
     */
    private String region = "cn-hangzhou";

    /**
     * 端点
     */
    private String endpoint;

    private String accessKeyId;

    private String accessKeySecret;

    /**
     * {@link #endpoint} 为自定义域名时必须
     */
    private Boolean useCName = Boolean.FALSE;

    /**
     * 使用内部域名 设置后可省略 {@link #endpoint}
     */
    private Boolean useInternalEndpoint = Boolean.TRUE;

    /**
     * 使用加速域名
     */
    private Boolean useAccelerateEndpoint = Boolean.FALSE;

    /**
     * 连接超时
     */
    private Duration connectTimeout = Duration.ofSeconds(5);

    /**
     * 读写超时
     */
    private Duration readWriteTimeout = Duration.ofSeconds(20);

    /**
     * 禁用 SSL
     */
    private Boolean disableSsl = Boolean.FALSE;

    /**
     * 预签名URL过期时间
     */
    private Duration presignExpiration = Duration.ofDays(1);

}
